import request from "@/utils/request";

/**
 * 读取单个商店
 * @param {*} params 
 * @returns 
 */
export function loadStoreById(params) {
    return request({
        url: "/admin/stores/loadStore",
        method: 'post',
        data: params
    })
}

/**
 * 得到全部商店
 * @returns 
 */
export function getAllStore() {
    return request({
        url: "/admin/stores/getAll",
        method: 'get'
    })
}
/**
 * 商店分页查询
 * @param {*} params 
 * @returns 
 */
export function storePageQuery(params) {
    return request({
        url: "/admin/stores/pageQuery",
        method: 'post',
        data: params
    })
}

/**
 * 创建商店
 * @param {*} params 
 * @returns 
 */
export function storeCreate(params) {
    return request({
        url: '/admin/stores/add',
        method: 'post',
        data: params
    })
}

/**
 * 编辑商店
 * @param {*} param 
 * @param {*} params 
 * @returns 
 */
export function storeEdit(param, params) {
    return request({
        url: `/admin/stores/update/${param}`,
        method: 'put',
        data: params
    })
}

/**
 * 删除商店
 * @param {*} param 
 * @returns 
 */
export function deleteStore(param) {
    return request({
        url: `/admin/stores/delete/${param}`,
        method: 'delete'
    })
}